Optimal. Leaf size=221 \[ \frac {5 (3 A+i B) x}{64 a^2 c^4}-\frac {i A-B}{64 a^2 c^4 f (i-\tan (e+f x))^2}-\frac {5 A+3 i B}{64 a^2 c^4 f (i-\tan (e+f x))}-\frac {i A+B}{32 a^2 c^4 f (i+\tan (e+f x))^4}-\frac {3 A-i B}{48 a^2 c^4 f (i+\tan (e+f x))^3}+\frac {3 i A}{32 a^2 c^4 f (i+\tan (e+f x))^2}+\frac {5 A+i B}{32 a^2 c^4 f (i+\tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.19, antiderivative size = 221, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.073, Rules used = {3669, 78, 209}
\begin {gather*} -\frac {5 A+3 i B}{64 a^2 c^4 f (-\tan (e+f x)+i)}+\frac {5 A+i B}{32 a^2 c^4 f (\tan (e+f x)+i)}-\frac {-B+i A}{64 a^2 c^4 f (-\tan (e+f x)+i)^2}-\frac {3 A-i B}{48 a^2 c^4 f (\tan (e+f x)+i)^3}-\frac {B+i A}{32 a^2 c^4 f (\tan (e+f x)+i)^4}+\frac {5 x (3 A+i B)}{64 a^2 c^4}+\frac {3 i A}{32 a^2 c^4 f (\tan (e+f x)+i)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 78
Rule 209
Rule 3669
Rubi steps
\begin {align*} \int \frac {A+B \tan (e+f x)}{(a+i a \tan (e+f x))^2 (c-i c \tan (e+f x))^4} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {A+B x}{(a+i a x)^3 (c-i c x)^5} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (\frac {i (A+i B)}{32 a^3 c^5 (-i+x)^3}+\frac {-5 A-3 i B}{64 a^3 c^5 (-i+x)^2}+\frac {i A+B}{8 a^3 c^5 (i+x)^5}+\frac {3 A-i B}{16 a^3 c^5 (i+x)^4}-\frac {3 i A}{16 a^3 c^5 (i+x)^3}+\frac {-5 A-i B}{32 a^3 c^5 (i+x)^2}+\frac {5 (3 A+i B)}{64 a^3 c^5 \left (1+x^2\right )}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {i A-B}{64 a^2 c^4 f (i-\tan (e+f x))^2}-\frac {5 A+3 i B}{64 a^2 c^4 f (i-\tan (e+f x))}-\frac {i A+B}{32 a^2 c^4 f (i+\tan (e+f x))^4}-\frac {3 A-i B}{48 a^2 c^4 f (i+\tan (e+f x))^3}+\frac {3 i A}{32 a^2 c^4 f (i+\tan (e+f x))^2}+\frac {5 A+i B}{32 a^2 c^4 f (i+\tan (e+f x))}+\frac {(5 (3 A+i B)) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{64 a^2 c^4 f}\\ &=\frac {5 (3 A+i B) x}{64 a^2 c^4}-\frac {i A-B}{64 a^2 c^4 f (i-\tan (e+f x))^2}-\frac {5 A+3 i B}{64 a^2 c^4 f (i-\tan (e+f x))}-\frac {i A+B}{32 a^2 c^4 f (i+\tan (e+f x))^4}-\frac {3 A-i B}{48 a^2 c^4 f (i+\tan (e+f x))^3}+\frac {3 i A}{32 a^2 c^4 f (i+\tan (e+f x))^2}+\frac {5 A+i B}{32 a^2 c^4 f (i+\tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.19, size = 232, normalized size = 1.05 \begin {gather*} \frac {\sec ^2(e+f x) (-i \cos (4 (e+f x))+\sin (4 (e+f x))) (-240 A+30 (A (-3-12 i f x)+B (i+4 f x)) \cos (2 (e+f x))+16 (3 A+4 i B) \cos (4 (e+f x))+3 A \cos (6 (e+f x))+9 i B \cos (6 (e+f x))-90 i A \sin (2 (e+f x))-30 B \sin (2 (e+f x))-360 A f x \sin (2 (e+f x))-120 i B f x \sin (2 (e+f x))-96 i A \sin (4 (e+f x))+32 B \sin (4 (e+f x))-9 i A \sin (6 (e+f x))+3 B \sin (6 (e+f x)))}{1536 a^2 c^4 f (-i+\tan (e+f x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.36, size = 170, normalized size = 0.77
method | result | size |
derivativedivides | \(\frac {\frac {3 i A}{32 \left (i+\tan \left (f x +e \right )\right )^{2}}-\frac {\frac {3 A}{16}-\frac {i B}{16}}{3 \left (i+\tan \left (f x +e \right )\right )^{3}}+\left (-\frac {5 B}{128}+\frac {15 i A}{128}\right ) \ln \left (i+\tan \left (f x +e \right )\right )-\frac {\frac {i A}{8}+\frac {B}{8}}{4 \left (i+\tan \left (f x +e \right )\right )^{4}}-\frac {-\frac {5 A}{32}-\frac {i B}{32}}{i+\tan \left (f x +e \right )}+\left (\frac {5 B}{128}-\frac {15 i A}{128}\right ) \ln \left (-i+\tan \left (f x +e \right )\right )-\frac {\frac {i A}{32}-\frac {B}{32}}{2 \left (-i+\tan \left (f x +e \right )\right )^{2}}-\frac {-\frac {5 A}{64}-\frac {3 i B}{64}}{-i+\tan \left (f x +e \right )}}{f \,a^{2} c^{4}}\) | \(170\) |
default | \(\frac {\frac {3 i A}{32 \left (i+\tan \left (f x +e \right )\right )^{2}}-\frac {\frac {3 A}{16}-\frac {i B}{16}}{3 \left (i+\tan \left (f x +e \right )\right )^{3}}+\left (-\frac {5 B}{128}+\frac {15 i A}{128}\right ) \ln \left (i+\tan \left (f x +e \right )\right )-\frac {\frac {i A}{8}+\frac {B}{8}}{4 \left (i+\tan \left (f x +e \right )\right )^{4}}-\frac {-\frac {5 A}{32}-\frac {i B}{32}}{i+\tan \left (f x +e \right )}+\left (\frac {5 B}{128}-\frac {15 i A}{128}\right ) \ln \left (-i+\tan \left (f x +e \right )\right )-\frac {\frac {i A}{32}-\frac {B}{32}}{2 \left (-i+\tan \left (f x +e \right )\right )^{2}}-\frac {-\frac {5 A}{64}-\frac {3 i B}{64}}{-i+\tan \left (f x +e \right )}}{f \,a^{2} c^{4}}\) | \(170\) |
norman | \(\frac {\frac {5 \left (i B +3 A \right ) x}{64 a c}-\frac {3 i A +B}{12 a c f}+\frac {B \left (\tan ^{2}\left (f x +e \right )\right )}{6 a c f}+\frac {73 \left (i B +3 A \right ) \left (\tan ^{3}\left (f x +e \right )\right )}{192 a c f}+\frac {55 \left (i B +3 A \right ) \left (\tan ^{5}\left (f x +e \right )\right )}{192 a c f}+\frac {5 \left (i B +3 A \right ) \left (\tan ^{7}\left (f x +e \right )\right )}{64 a c f}+\frac {5 \left (i B +3 A \right ) x \left (\tan ^{2}\left (f x +e \right )\right )}{16 a c}+\frac {15 \left (i B +3 A \right ) x \left (\tan ^{4}\left (f x +e \right )\right )}{32 a c}+\frac {5 \left (i B +3 A \right ) x \left (\tan ^{6}\left (f x +e \right )\right )}{16 a c}+\frac {5 \left (i B +3 A \right ) x \left (\tan ^{8}\left (f x +e \right )\right )}{64 a c}+\frac {\left (-5 i B +49 A \right ) \tan \left (f x +e \right )}{64 a c f}}{a \,c^{3} \left (1+\tan ^{2}\left (f x +e \right )\right )^{4}}\) | \(281\) |
risch | \(\frac {5 i x B}{64 a^{2} c^{4}}+\frac {15 x A}{64 a^{2} c^{4}}-\frac {{\mathrm e}^{8 i \left (f x +e \right )} B}{512 a^{2} c^{4} f}-\frac {i {\mathrm e}^{8 i \left (f x +e \right )} A}{512 a^{2} c^{4} f}-\frac {{\mathrm e}^{6 i \left (f x +e \right )} B}{96 a^{2} c^{4} f}-\frac {i {\mathrm e}^{6 i \left (f x +e \right )} A}{64 a^{2} c^{4} f}-\frac {3 \cos \left (4 f x +4 e \right ) B}{128 a^{2} c^{4} f}-\frac {7 i \cos \left (4 f x +4 e \right ) A}{128 a^{2} c^{4} f}-\frac {i \sin \left (4 f x +4 e \right ) B}{64 a^{2} c^{4} f}+\frac {\sin \left (4 f x +4 e \right ) A}{16 a^{2} c^{4} f}-\frac {\cos \left (2 f x +2 e \right ) B}{32 a^{2} c^{4} f}-\frac {7 i \cos \left (2 f x +2 e \right ) A}{64 a^{2} c^{4} f}+\frac {i \sin \left (2 f x +2 e \right ) B}{32 a^{2} c^{4} f}+\frac {13 \sin \left (2 f x +2 e \right ) A}{64 a^{2} c^{4} f}\) | \(281\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.83, size = 134, normalized size = 0.61 \begin {gather*} \frac {{\left (120 \, {\left (3 \, A + i \, B\right )} f x e^{\left (4 i \, f x + 4 i \, e\right )} - 3 \, {\left (i \, A + B\right )} e^{\left (12 i \, f x + 12 i \, e\right )} - 8 \, {\left (3 i \, A + 2 \, B\right )} e^{\left (10 i \, f x + 10 i \, e\right )} - 30 \, {\left (3 i \, A + B\right )} e^{\left (8 i \, f x + 8 i \, e\right )} - 240 i \, A e^{\left (6 i \, f x + 6 i \, e\right )} - 24 \, {\left (-3 i \, A + 2 \, B\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + 6 i \, A - 6 \, B\right )} e^{\left (-4 i \, f x - 4 i \, e\right )}}{1536 \, a^{2} c^{4} f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.62, size = 498, normalized size = 2.25 \begin {gather*} \begin {cases} \frac {\left (- 2061584302080 i A a^{10} c^{20} f^{5} e^{8 i e} e^{2 i f x} + \left (51539607552 i A a^{10} c^{20} f^{5} e^{2 i e} - 51539607552 B a^{10} c^{20} f^{5} e^{2 i e}\right ) e^{- 4 i f x} + \left (618475290624 i A a^{10} c^{20} f^{5} e^{4 i e} - 412316860416 B a^{10} c^{20} f^{5} e^{4 i e}\right ) e^{- 2 i f x} + \left (- 773094113280 i A a^{10} c^{20} f^{5} e^{10 i e} - 257698037760 B a^{10} c^{20} f^{5} e^{10 i e}\right ) e^{4 i f x} + \left (- 206158430208 i A a^{10} c^{20} f^{5} e^{12 i e} - 137438953472 B a^{10} c^{20} f^{5} e^{12 i e}\right ) e^{6 i f x} + \left (- 25769803776 i A a^{10} c^{20} f^{5} e^{14 i e} - 25769803776 B a^{10} c^{20} f^{5} e^{14 i e}\right ) e^{8 i f x}\right ) e^{- 6 i e}}{13194139533312 a^{12} c^{24} f^{6}} & \text {for}\: a^{12} c^{24} f^{6} e^{6 i e} \neq 0 \\x \left (- \frac {15 A + 5 i B}{64 a^{2} c^{4}} + \frac {\left (A e^{12 i e} + 6 A e^{10 i e} + 15 A e^{8 i e} + 20 A e^{6 i e} + 15 A e^{4 i e} + 6 A e^{2 i e} + A - i B e^{12 i e} - 4 i B e^{10 i e} - 5 i B e^{8 i e} + 5 i B e^{4 i e} + 4 i B e^{2 i e} + i B\right ) e^{- 4 i e}}{64 a^{2} c^{4}}\right ) & \text {otherwise} \end {cases} + \frac {x \left (15 A + 5 i B\right )}{64 a^{2} c^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.05, size = 241, normalized size = 1.09 \begin {gather*} \frac {\frac {60 \, {\left (3 i \, A - B\right )} \log \left (\tan \left (f x + e\right ) + i\right )}{a^{2} c^{4}} + \frac {60 \, {\left (-3 i \, A + B\right )} \log \left (\tan \left (f x + e\right ) - i\right )}{a^{2} c^{4}} - \frac {6 \, {\left (-45 i \, A \tan \left (f x + e\right )^{2} + 15 \, B \tan \left (f x + e\right )^{2} - 110 \, A \tan \left (f x + e\right ) - 42 i \, B \tan \left (f x + e\right ) + 69 i \, A - 31 \, B\right )}}{a^{2} c^{4} {\left (\tan \left (f x + e\right ) - i\right )}^{2}} + \frac {-375 i \, A \tan \left (f x + e\right )^{4} + 125 \, B \tan \left (f x + e\right )^{4} + 1740 \, A \tan \left (f x + e\right )^{3} + 548 i \, B \tan \left (f x + e\right )^{3} + 3114 i \, A \tan \left (f x + e\right )^{2} - 894 \, B \tan \left (f x + e\right )^{2} - 2604 \, A \tan \left (f x + e\right ) - 612 i \, B \tan \left (f x + e\right ) - 903 i \, A + 93 \, B}{a^{2} c^{4} {\left (\tan \left (f x + e\right ) + i\right )}^{4}}}{1536 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 10.17, size = 247, normalized size = 1.12 \begin {gather*} \frac {\frac {B}{12\,a^2\,c^4}+{\mathrm {tan}\left (e+f\,x\right )}^4\,\left (-\frac {5\,B}{32\,a^2\,c^4}+\frac {A\,15{}\mathrm {i}}{32\,a^2\,c^4}\right )+{\mathrm {tan}\left (e+f\,x\right )}^3\,\left (\frac {5\,A}{32\,a^2\,c^4}+\frac {B\,5{}\mathrm {i}}{96\,a^2\,c^4}\right )+{\mathrm {tan}\left (e+f\,x\right )}^5\,\left (\frac {15\,A}{64\,a^2\,c^4}+\frac {B\,5{}\mathrm {i}}{64\,a^2\,c^4}\right )+{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (-\frac {25\,B}{96\,a^2\,c^4}+\frac {A\,25{}\mathrm {i}}{32\,a^2\,c^4}\right )-\mathrm {tan}\left (e+f\,x\right )\,\left (\frac {17\,A}{64\,a^2\,c^4}+\frac {B\,17{}\mathrm {i}}{192\,a^2\,c^4}\right )+\frac {A\,1{}\mathrm {i}}{4\,a^2\,c^4}}{f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^6+{\mathrm {tan}\left (e+f\,x\right )}^5\,2{}\mathrm {i}+{\mathrm {tan}\left (e+f\,x\right )}^4+{\mathrm {tan}\left (e+f\,x\right )}^3\,4{}\mathrm {i}-{\mathrm {tan}\left (e+f\,x\right )}^2+\mathrm {tan}\left (e+f\,x\right )\,2{}\mathrm {i}-1\right )}+\frac {5\,x\,\left (3\,A+B\,1{}\mathrm {i}\right )}{64\,a^2\,c^4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________